package com.woniu.punishcomplaintnotice.mapper;

import com.woniu.common.entity.PunishmentRecord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PunishMapper {
    @Insert("insert into punishment_record values(null,#{name},#{photo},#{punish_date},#{active},#{result},#{address},#{u_id})")
    void insertPunishs(PunishmentRecord punishmentRecord);

    @Select("select * from punishment_record where u_id = #{u_id} ")
    List<PunishmentRecord> findPunishmentByu_id(Integer u_id);
     
    //查询所有违规行为
    @Select("select * from punishment_record")
    List<PunishmentRecord> findAllPunishment();
}
